<script>
    import moment from 'moment';
    import { EmptyToken } from '../lib/token.js';
    import { push } from 'svelte-spa-router'

    let date = moment().format("YYYY-MM-DD HH:mm:ss");

    resetDate();

    function resetDate(){
        date = moment().format("YYYY-MM-DD HH:mm:ss");
        setTimeout(resetDate,1000);
    }

    function quit(){
        EmptyToken();
        location.href = "/";
    }

</script>

<header>
    <div class="columns">
        <div class="column is-3"></div>
        <div class="column is-5" style="text-align: center">
            CFTCEX 交易所管理平台
        </div>

        <div class="column is-5 logout font12" style="color: #666666;display: flex;justify-content: center;align-items: center">
            <span style="margin-right: 4px">{date}</span>
            <img src="images/out.png" alt="" style="width: 12px;margin-right: 4px">
            <a class="blue" on:click={quit}>
                退出登录
            </a>
        </div>
    </div>
</header>

<style>
    header {
        background-color: #fff;
        padding: 15px 0;
    }
    header p {
        color: #20222A;
    }
    .logout{
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    .font12{
        font-size: 12px;
    }
</style>
